/*
 * index.js
 */
var location_ = "192.168.3.128";   //服务器IP
var location_delivery = "192.168.3.128"
//***********************************************
//名字：登录状态方法 
//说明：登录成功传递登录用户信息
//***********************************************
var Account_box = document.getElementById("Account");
var MerchantName_box = document.getElementById("MerchantName");
var GroupName_box = document.getElementById("GroupName");
var Account_2_box = document.getElementById("Account_2");

var Account = getCookie("Account");
var MerchantName = getCookie("MerchantName");
var GroupName = getCookie("GroupName");
var AccessToken = getCookie("AccessToken");
var APIHost = getCookie("APIHost");

console.log(Account)
console.log(MerchantName)
console.log(GroupName)
console.log(AccessToken)
console.log(APIHost)
console.log(document.cookie)
//Account_box.innerText = Account;
//MerchantName_box.innerText = MerchantName;
//GroupName_box.innerText = GroupName;
Account_2_box.innerHTML = Account;

//***********************************************
//名字： APIHost
//功能： 动态IP地址
//说明：
//***********************************************

var location_ = "192.168.3.128";   //服务器IP
var location_delivery = "192.168.3.128"

//***********************************************
//名字：getCookie（） 
//功能：取出一个cookie的方法
//说明：cname 名字
//***********************************************
function getCookie(cname){
  var name = cname + "=";
  var ca = document.cookie.split(';');
  for(var i=0; i<ca.length; i++) 
  {
    var c = ca[i].trim();
    if (c.indexOf(name)==0) return c.substring(name.length,c.length);
  }
  return cname;
}


//***********************************************
//名字：deCookie（） 
//功能：删除一个cookie的方法
//说明：cname 名字
//***********************************************

 function deCookie(name)  
{  
    var exp = new Date();  
    exp.setTime(exp.getTime() - 1000);  
    var cval=getCookie(name);  
    if(cval!=null)  
    document.cookie= name + "="+cval+";expires="+exp.toGMTString();  
} 

//***********************************************
//名字：model
//说明：通过请求传递 AccessToken
//***********************************************
var model = {
                AccessToken: AccessToken
            };
// 
 var result;
	var box = document.getElementById("tr_1");
	var text = document.getElementById("text");
	var box_ = document.getElementById("myBox_1");           
            
//-----------------------------------------------------------------首页交易方法---------------------------------------------------------------


function Merchant(){
	// $(".table-responsive ").fadeOut(2000);
	// $(".table-responsive").css('left','-1250px');
	// $(".table-responsive").animate({left:'0px'},2000);
	

	box.innerHTML = "<img src='img/5-160914192R3.gif' style='width: 30%; margin-left: 35%;'/>";
	box_.innerHTML = "正在加载数据...";
//	table-responsive 
	$("#myBox").css("background-color","rgb(6，39，52)")
//	box.style.backgroundColor = "rgb(6，39，52)";
	text.innerHTML = "共计 "+ 0 +" 条数据";
	console.log(model)
	
$.ajax({
	 type:"POST",
	 url: APIHost+"/Merchant/Orders/PageList",
	 data:model,
	success:function(result){
	if (result.Status != 1) {
		return alert(result.Message)
	}else{
		console.log(result)
	box.innerHTML = "";
	box_.innerHTML = "";
	var length = result.Data.Data.length;
	text.innerHTML = "共计 "+ length +" 条数据"
	box.innerHTML =
//	'<tr id="tr_1">'+
					'<th class="text-center">订单号</th>'+
					'<th class="text-center active">玩家账号</th>'+
//					'<th class="text-center" style="width: 4em;">代理ID</th>'+
//					'<th sortBy="age" class="text-center success">渠道ID</th>'+
					'<th class="text-center">创建时间</th>'+
					'<th class="text-center warning">修改时间</th>'+
//					'<th class="text-center" sortBy="createTime">收益</th>'+
					'<th class="text-center danger">Flag</th>'+
					'<th class="text-center">Instcode</th>'+
//					'<th class="text-center info">IP</th>'+
					'<th class="text-center">IsBuckle</th>'+
//					'<th class="text-center active">MerchantId</th>'+
//					'<th class="text-center">MirId</th>'+
//					'<th sortBy="age" class="text-center success">MirName</th>'+
//					'<th class="text-center">Msg</th>'+
					'<th class="text-center warning">OrderMoney</th>'+
//					'<th class="text-center" sortBy="createTime">ProductId</th>'+
//					'<th class="text-center danger">ProductName</th>'+
//					'<th class="text-center">QQ</th>'+
//					'<th class="text-center active">RefUrl</th>'+
					'<th class="text-center">Sent</th>'+
					'<th class="text-center success">Status</th>'+
					'<th class="text-center">Stop</th>'+
//					'<th sortBy="age" class="text-center warning">Times</th>'+
					'<th class="text-center">游戏网官</th>'+
					'<th class="text-center danger">操作</th>'
//				'</tr>';
	

	for(var index = 0; index <= length; index++) {
		
		var trans =  result.Data.Data[index].TransNo;
		var tran = "'"+trans+"'"
//			console.log(result.Data.Data[0].TransNo)
//		console.log(result.Data.Data[index].Account)
		/*
		 *转换 CreateTime 时间戳
		 */
		time = result.Data.Data[index].CreateTime.substring(6, 19) - 0;
		date = new Date(time);
		Y = date.getFullYear() + '-';
		M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
		D = (date.getDate()<10? "0"+date.getDate(): date.getDate()) + "/";;
		h = (date.getHours()<10? "0"+date.getHours():date.getHours())+ ":" ;;
		m = (date.getMinutes()<10? "0"+date.getMinutes():date.getMinutes())+":";
		s = (date.getSeconds()<10? "0"+date.getSeconds():date.getSeconds());
		var CreateTime = Y + M + D + h + m + s;
//		console.log(CreateTime)
//		console.log(D);
		/*
		 * 转换 FinalTime 时间戳
		 */
		var FinalTime = result.Data.Data[index].FinalTime;
        //console.log(FinalTime)
		if (FinalTime != null) {
				time1 = FinalTime.substring(6,19) - 0;
				f_Date = new Date(time1);
				finalY = f_Date.getFullYear() + "-";
				finaM = (f_Date.getMonth() + 1< 10? "0" + (f_Date.getMonth()+1):f_Date.getMonth()+1) + "-";
				finaD = (f_Date.getDate()<10? "0"+f_Date.getDate(): f_Date.getDate()) + "/";
				finaH = (f_Date.getHours()<10? "0"+f_Date.getHours():f_Date.getHours())+ ":" ;
				fina_m = (f_Date.getMinutes()<10? "0"+f_Date.getMinutes():f_Date.getMinutes())+":";
				finaS = (f_Date.getSeconds()<10? "0"+f_Date.getSeconds():f_Date.getSeconds());
				FinalTime = finalY + finaM + finaD + finaH + fina_m + finaS;
		} else{
		
			FinalTime = "未作修改"
		}
		box_.innerHTML += 
			" <tr>"+
			"<td class='text-center order'>" + trans + "</td>" +
			"<td class='text-center active'>" + result.Data.Data[index].Account + "</td>" +
//			"<td class='text-center '>" + result.Data.Data[index].AgentId + "</td>" +
//			"<td class='text-center success'>" + result.Data.Data[index].ChannelId + "</td>" +
			"<td class='text-center '>" + CreateTime +"</td>" +
			"<td class='text-center warning'>" + FinalTime + "</td>" +
//			"<td class='text-center'>" + result.Data.Data[index].Earning + "</td>" +
			"<td class='text-center danger'>" + result.Data.Data[index].Flag + "</td>" +
			"<td class='text-center'>" + result.Data.Data[index].Instcode + "</td>" +
//			"<td class='text-center info'>" + result.Data.Data[index].IP + "</td>" +
			"<td class='text-center'>" + result.Data.Data[index].IsBuckle + "</td>" +
//			"<td class='text-center active'>" + result.Data.Data[index].MerchantId + "</td>" +
//			"<td class='text-center'>" + result.Data.Data[index].MirId + "</td>" +
//			"<td class='text-center success'>" + result.Data.Data[index].MirName + "</td>" +
//			"<td class='text-center'>" + result.Data.Data[index].Msg + "</td>" +
			"<td class='text-center warning'>" + result.Data.Data[index].OrderMoney + "</td>" +
//			"<td class='text-center'>" + result.Data.Data[index].ProductId + "</td>" +
//			"<td class='text-center danger'>" + result.Data.Data[index].ProductName + "</td>" +
//			"<td class='text-center'>" + result.Data.Data[index].QQ + "</td>" +
//			"<td class='text-center active'>" + result.Data.Data[index].RefUrl + "</td>" +
			"<td class='text-center'>" + result.Data.Data[index].Sent + "</td>" +
			"<td class='text-center success'>" + result.Data.Data[index].Status + "</td>" +
			"<td class='text-center'>" + result.Data.Data[index].Stop + "</td>" +
//			"<td class='text-center warning'>" + result.Data.Data[index].Times + "</td>" +
			"<td class='text-center'>" + result.Data.Data[index].Host+":" +result.Data.Data[index].Port+ "</td>" +
			"<td class='text-center danger'>" + 
			'<div class="btn-group" style="width: 80px;">'+
  					'<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="height: 23px; padding: 0 20px;">'+
    					'操作<span class="caret"></span>'+
// 				    '<span class="sr-only">Toggle Dropdown</span>	'+
 					'</button>'+
 					'<ul class="dropdown-menu">'+
 				   '<li ><a href="#" class="faH" onclick="deli('+ tran +')">发货</a></li>'+
 				   '<li><a href="#">详情</a></li>'+
   				   '<li><a href="#">重发</a></li>'+
  				   '<li role="separator" class="divider"></li>'+
 				   '<li><a href="#">返回</a></li>'+
 				   '</ul>'+
			'</div>'+
			"</td>"+
		"</tr>"	;
		
	
	}
	}
 },
	 error:function(result,s){ 
	 	$(".modal-body").html(result.responseText)
	 	$('#myModal').modal('show');
		 box_.innerHTML = "请求数据时出错，请重试...";
	 	console.log(result.responseText)
	 },
})//ajax
// $(".table-responsive ").fadeIn(2000);
}//fun


//---------------------------------------------------------------发货方法---------------------------------------------------------------
  function deli(el){
	// var box = document.getElementById("myBox");
	// var text = document.getElementById("text");
	// var box_ = document.getElementById("myBox_1")

//	box.innerHTML = "<img src='img/5-160914192R3.gif' style='width: 50%; margin-left: 25%;box-shadow: 0 0 25px rgb(2,23,36);'/>";
//	box_.innerHTML = "正在加载数据...";
	text.innerHTML = "共计 "+ 0 +" 条数据";

//	box.innerHTML +=  " ";
	console.log(model)
	console.log(model.AccessToken)
//	var model1 = model[0]
	$.ajax({
		type: "POST",
	url: APIHost +"/Merchant/Orders/Deliver",
//	beforeSend: function(data) {
//		//发送ajax请求之前向http的head里面加入验证信息
//      data.setRequestHeader("AccessToken", "123");
//  },
	data:{orderNo: el,AccessToken:model.AccessToken},
	
	dataType:'json',
	success:function(data){
			if (data.Status != 1) {
				//失败状态
//		return alert(data.Message)
		$(".modal-body").html(data.Message);
		$('#myModal').modal('show');
	}else{
//		box.innerHTML = "";
//		box_.innerHTML = "";
		//成功状态
		console.log(data)
//		var length = data.Data.length;
//		text.innerHTML = "共计 "+ length +" 条数据"
//	for(var index = 0; index <= length; index++) {
//		
////		box_.innerHTML += 	" " ;	
//		}
	}

	},
	error:function(el){
//	alert(el)
//	console.log(el)
$(".modal-body").html(el.responseText);
$('#myModal').modal('show');
//box_.innerHTML = "请求数据时出错，请重试...";
	}
	});
}

//--------------------------------------------------------分区管理方法---------------------------------------------------------------

function Servicelist(){
	// var box = document.getElementById("myBox");
	// var text = document.getElementById("text");
	// var box_ = document.getElementById("myBox_1");

	box.innerHTML = "<img src='img/5-160914192R3.gif' style='width: 30%; margin-left: 35%;'/>";
	box_.innerHTML = "正在加载数据...";
	text.innerHTML = "共计 "+ 0 +" 条数据";
	
	
//	$.post("http://"+ location_ +"/Merchant/Servers/Servicelist", function(result) {
	$.ajax({
	 type:"POST",
	 url:APIHost +"/Merchant/Servers/Servicelist",
//	 beforeSend: function(data) {
//		//发送ajax请求之前向http的head里面加入验证信息
//      data.setRequestHeader("AccessToken", "123");
//  },
	 error:function(el){
		$(".modal-body").html(el.responseText);
		$('#myModal').modal('show');
		box_.innerHTML = "请求数据时出错，请重试...";
					},
	data:model,
	success:function(result){
		console.log(result.Data[1])
		if (result.Status != 1) {
		return alert(result.Message)
	}else{
		box.innerHTML = "";
		box_.innerHTML = "";
	var length = result.Data.length;
	text.innerHTML = "共计 "+ length +" 条数据";
	box.innerHTML += '<tr id="tr_1">'+
					'<th class="text-center active">Category</th>'+
					'<th class="text-center">Host</th>'+
					'<th sortBy="age" class="text-center success">Port</th>'+
					'<th class="text-center">MirId</th>'+
					'<th class="text-center">MerchantId</th>'+
					'<th class="text-center warning">MirName</th>'+
					'<th class="text-center" sortBy="createTime">Path</th>'+
					//'<th class="text-center danger">Sort</th>'+
					'<th class="text-center">Stop</th>'+
					'<th class="text-center info">TempName</th>'+
					'<th class="text-center">Version</th>'+
					'<th class="text-center">操作</th>'+
				'</tr>'
	
		
	for(var index = 0; index <= length; index++) {
//		console.log(result.Data)
		var trans =  result.Data[ index ].MirId;
		var tran = "'"+trans+"'"
//		console.log(trans)
		
		
		box_.innerHTML += 
			" <tr><td class='text-center active'>" + result.Data[index].Category + "</td>" +
			"<td class='text-center '>" + result.Data[index].Host + "</td>" +
			"<td class='text-center success'>" + result.Data[index].Port + "</td>" +
			"<td class='text-center '>" + result.Data[index].MirId + "</td>" +
			"<td class='text-center '>" + result.Data[index].MerchantId + "</td>" +
			"<td class='text-center warning'>" + result.Data[index].MirName + "</td>" +
			"<td class='text-center'>" + result.Data[index].Path + "</td>" +
			"<td class='text-center danger'>" + result.Data[index].Sort + "</td>" +
//			"<td class='text-center'>" + result.Data[index].Stop + "</td>" +
			"<td class='text-center info'>" + result.Data[index].TempName + "</td>" +
			"<td class='text-center'>" + result.Data[index].Version + "</td>" +
			"<td class='text-center'>"+
			'<div class="btn-group" style="width: 80px;">'+
  					'<button type="button" class="btn btn-success">操作</button>	'+
  					'<button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">'+
    					'<span class="caret"></span>'+
   				    '<span class="sr-only">Toggle Dropdown</span>	'+
 					'</button>'+
 					'<ul class="dropdown-menu">'+
 				   '<li><a href="#">充值</a></li>'+
 				   '<li><a href="#" onclick="Test('+ tran +')">检测</a></li>'+
 				   '<li><a href="#">编辑</a></li>'+
 				   '<li><a href="#" onclick="Load('+ tran +')">加载 </a></li>'+
 				   '<li><a href="#" onclick="Ghost('+ tran +')">克隆</a></li>'+
 				   '<li><a href="#">补发</a></li>'+
 				   '<li><a href="#">删除</a></li>'+
  				   '<li role="separator" class="divider"></li>'+
 				   '<li><a href="#">返回</a></li>'+
 				   '</ul>'+
			'</div>'+
			"</td>" +
		"</tr>  "
	}
	}
	}
})
}

//---------------------------------------------------------------管理员方法---------------------------------------------------------------
function Groups(){
	console.log("管理员")
	// var box = document.getElementById("myBox");
	// var text = document.getElementById("text");
	// var box_ = document.getElementById("myBox_1")

	box.innerHTML = "<img src='img/5-160914192R3.gif' style='width: 30%; margin-left: 35%;'/>";
	box_.innerHTML = "正在加载数据...";
	text.innerHTML = "共计 "+ 0 +" 条数据";
	$(".table-responsive ").fadeToggle(400);
//	$.post("http://"+ location_ +"/Merchant/Permission/Groups", function(result) {
	$.ajax({
	 type:"POST",
	 url:APIHost +"/Merchant/Permission/Groups",
//	 beforeSend: function(data) {
//		//发送ajax请求之前向http的head里面加入验证信息
//      data.setRequestHeader("AccessToken", "123");
//  },
	 error:function(el){
		$(".modal-body").html(el.responseText);
		$('#myModal').modal('show');
		box_.innerHTML = "请求数据时出错，请重试...";
					},
	data:model,
	success:function(result){
		if (result.Status != 1) {
		return alert(result.Message)
	}else{
		box.innerHTML = "";
		box_.innerHTML = "";
		var length = result.Data.length;
		console.log(length);


		text.innerHTML = "共计 "+ length +" 条数据";
		box.innerHTML += '<tr>'+
					'<th class="text-center active">PermissionGroupId</th>'+
					'<th class="text-center">Name</th>'+
					'<th sortBy="age" class="text-center success">Type</th>'+
					'<th class="text-center">Owner</th>'+
					'<th class="text-center warning">Comment</th>'+
					'<th class="text-center" sortBy="createTime">Enable</th>'+
					'<th class="text-center danger">ActionIds</th>	'+
				'</tr>';
		
		
	for(var index = 0; index <= length; index++) {
		box_.innerHTML += 
			" <tr><td class='text-center active'>" + result.Data[index].PermissionGroupId + "</td>" +
			"<td class='text-center '>" + result.Data[index].Name + "</td>" +
			"<td class='text-center success'>" + result.Data[index].Type + "</td>" +
			"<td class='text-center '>" + result.Data[index].Owner + "</td>" +
			"<td class='text-center warning'>" + result.Data[index].Comment + "</td>" +
			"<td class='text-center'>" + result.Data[index].Enable + "</td>" +
			"<td class='text-center danger'>" + result.Data[index].ActionIds + "</td></tr>"
	}
	}
}
})
$(".table-responsive ").fadeToggle(400);
};


//--------------------------------------------------------游戏类-------------------------------------------------------
function Grouplist(){
	// var box = document.getElementById("myBox");
	// var text = document.getElementById("text");
	// var box_ = document.getElementById("myBox_1")

	box.innerHTML = "<img src='img/5-160914192R3.gif' style='width: 30%; margin-left: 35%;'/>";
	box_.innerHTML = "正在加载数据...";
	text.innerHTML = "共计 "+ 0 +" 条数据";
	
	

//$.get("http://"+ location_ +"/Merchant/Domain/Grouplist", function(result) {
	$.ajax({
	 type:"POST",
	 url:APIHost+"/Merchant/Domain/Grouplist",
//	 beforeSend: function(data) {
//		//发送ajax请求之前向http的head里面加入验证信息
//      data.setRequestHeader("AccessToken", "123");
//  },
	 error:function(el){
		$(".modal-body").html(el.responseText);
		$('#myModal').modal('show');
		box_.innerHTML = "请求数据时出错，请重试...";
					},
	data:model,
	success:function(result){
	if (result.Status != 1) {
		return alert(result.Message)
	}else{
		box.innerHTML = "";
		box_.innerHTML = "";
		var length = result.Data.length;
		console.log(result);
		text.innerHTML = "共计 "+ length +" 条数据";
		
		
		box.innerHTML += '<tr>'+
					'<th class="text-center active">GroupId</th>'+
					'<th class="text-center">MerchantId</th>'+
					'<th sortBy="age" class="text-center success">Name</th>'+
					'<th class="text-center">Url</th>'+
					'<th class="text-center warning">GetURL</th>'+
				'</tr>';
		
		for(var index = 0; index <= 3; index++) {
		box_.innerHTML += 	" <tr><td class='text-center active'>" + result.Data[index].GroupId + "</td>" +
			"<td class='text-center '>" + result.Data[index].MerchantId + "</td>" +
			"<td class='text-center success'>" + result.Data[index].Name + "</td>" +
			"<td class='text-center '>" + result.Data[index].Url + "</td>" +
			"<td class='text-center danger'>" + result.Data[index].GetURL + "</td></tr>"	
	}
	}
}
})
}

//--------------------------------------------------------热血传奇（模板）--------------------------------------------------------
function GetTemplateItems(){
	/*
 * game.js
 */
	// var box = document.getElementById("myBox");
	// var text = document.getElementById("text");
	// var box_ = document.getElementById("myBox_1")

	box.innerHTML = "<img src='img/5-160914192R3.gif' style='width: 30%; margin-left: 35%;'/>";
	box_.innerHTML = "正在加载数据...";
	text.innerHTML = "共计 "+ 0 +" 条数据";




//$.get("http://"+ location_ +"/Merchant/Templates/GetTemplateItems", function(result) {
	$.ajax({
	 type:"POST",
	 url:APIHost+"/Merchant/Templates/GetTemplateItems",
//	 beforeSend: function(data) {
//		//发送ajax请求之前向http的head里面加入验证信息
//      data.setRequestHeader("AccessToken", "123");
//  },
	 error:function(el){
		$(".modal-body").html(el.responseText);
		$('#myModal').modal('show');
		box_.innerHTML = "请求数据时出错，请重试...";
					},
	data:model,
	success:function(result){
	
	if (result.Status != 1) {
		return alert(result.Message)
	}else{
		box.innerHTML = "";
		box_.innerHTML = "";
	var length = result.Data.length;
		console.log(result.Data);
	
	
		text.innerHTML = "共计 "+ length +" 条数据";
		box.innerHTML = 
		// '<tr>'+
					'<th class="text-center active">TemplateId</th>'+
					'<th class="text-center">MerchantId</th>'+
					'<th sortBy="age" class="text-center success">Category</th>'+
					'<th class="text-center">Command</th>'+
					'<th class="text-center">Name</th>'+
					'<th class="text-center warning">GameName</th>'+
					'<th class="text-center ">Scale</th>'+
					'<th class="text-center warning">Unit</th>	'
				// '</tr>';
	for(var index = 0; index <= length; index++) {
		

		box_.innerHTML += 	" <tr><td class='text-center active'>" + result.Data[index].TemplateId + "</td>" +
			"<td class='text-center '>" + result.Data[index].MerchantId + "</td>" +
			"<td class='text-center success'>" + result.Data[index].Category + "</td>" +
			"<td class='text-center '>" + result.Data[index].Command + "</td>" +
			"<td class='text-center '>" + result.Data[index].Name + "</td>" +
			"<td class='text-center '>" + result.Data[index].GameName + "</td>" +
			"<td class='text-center '>" + result.Data[index].Scale + "</td>" +
			"<td class='text-center danger'>" + result.Data[index].Unit + "</td></tr>"
	}
	}
}
})
}

//GetAccounts方法
function GetAccounts(){
var box = document.getElementById("myBox");
	// var text = document.getElementById("text");
	// var box_ = document.getElementById("myBox_1")

	box.innerHTML = "<img src='img/5-160914192R3.gif' style='width: 30%; margin-left: 35%;'/>";
	box_.innerHTML = "正在加载数据...";
	text.innerHTML = "共计 "+ 0 +" 条数据";
	
	
	box.innerHTML += '<tr>'+
					'<th class="text-center active">AccountId</th>'+
					'<th class="text-center">Account</th>'+
					'<th sortBy="age" class="text-center success">MerchantId</th>'+
					'<th class="text-center">PermissionGroupId</th>'+
					'<th class="text-center warning">Password</th>'+
					'<th class="text-center warning">PasswordSalt</th>'+
					'<th class="text-center warning">Duration</th>'+
					'<th class="text-center active">Integral</th>'+
					'<th class="text-center">CreatedOn</th>'+
					'<th class="text-center">CreatedBy</th>'+
					'<th class="text-center warning">CheckinOn</th>'+
					'<th class="text-center warning">CheckoutOn</th>'+
					'<th class="text-center warning">ExpiredOn</th>'+
					'<th class="text-center warning">IsLock</th>'+
					'<th class="text-center warning">AccessToken</th>	'+
				'</tr>'

//$.get("http://"+ location_ +"/Platform/Merchant/GetAccounts", function(result) {
	$.ajax({
	 type:"POST",
	 url:"http://"+ location_ +"/Platform/Merchant/GetAccounts",
//	 beforeSend: function(data) {
//		//发送ajax请求之前向http的head里面加入验证信息
//      data.setRequestHeader("AccessToken", "123");
//  },
	 error:function(el){
		$(".modal-body").html(el.responseText);
		$('#myModal').modal('show');
		box_.innerHTML = "请求数据时出错，请重试...";
					},
	data:model,
	success:function(result){
	
	if (result.Status != 1) {
		return alert(result.Message)
	}else{
		box.innerHTML = "";
		box_.innerHTML = "";
	var length = result.Data.length;
		console.log(result.Data);

	
		text.innerHTML = "共计 "+ length +" 条数据"
	for(var index = 0; index <= length; index++) {
		
		box_.innerHTML += 	" <tr><td class='text-center active'>" + result.Data[index].AccountId + "</td>" +
			"<td class='text-center '>" + result.Data[index].Account + "</td>" +
			"<td class='text-center success'>" + result.Data[index].MerchantId + "</td>" +
			"<td class='text-center '>" + result.Data[index].PermissionGroupId + "</td>" +
			"<td class='text-center '>" + result.Data[index].Password + "</td>" +
			"<td class='text-center '>" + result.Data[index].PasswordSalt + "</td>" +
			"<td class='text-center '>" + result.Data[index].Duration + "</td>" +
			"<td class='text-center '>" + result.Data[index].Integral + "</td>" +
			"<td class='text-center success'>" + result.Data[index].CreatedOn + "</td>" +
			"<td class='text-center '>" + result.Data[index].CreatedBy + "</td>" +
			"<td class='text-center '>" + result.Data[index].CheckinOn + "</td>" +
			"<td class='text-center '>" + result.Data[index].CheckoutOn + "</td>" +
			"<td class='text-center '>" + result.Data[index].ExpiredOn + "</td>" +
			"<td class='text-center '>" + result.Data[index].IsLock + "</td>" +
			"<td class='text-center danger'>" + result.Data[index].AccessToken + "</td></tr>"
	}
	}
	}
})
}


//--------------------------------------------------------Mirdivisions方法--------------------------------------------------------
function Mirdivisions(){
	// var box = document.getElementById("myBox");
	// var text = document.getElementById("text");
	// var box_ = document.getElementById("myBox_1");

	box.innerHTML = "<img src='img/5-160914192R3.gif' style='width: 30%; margin-left: 35%;'/>";
	box_.innerHTML = "正在加载数据...";
	text.innerHTML = "共计 "+ 0 +" 条数据";
	
	

				
				
$.ajax({
	url:APIHost+"/Platform/Mir/Mirdivisions", 
	type:"POST",
	data:model,
	success:function(result) {
		console.log(result.Data[0].MirId)
	if (result.Status != 1) {
		return alert(result.Message)
	}else{
		box.innerHTML = "";
		box_.innerHTML = "";
	var length = result.Data.length;
		text.innerHTML = "共计 "+ length +" 条数据"
		box.innerHTML += '<tr>'+
					'<th class="text-center info">排序</th>'+
					'<th class="text-center ">编号</th>'+
					'<th class="text-center success">分区名称</th>'+
					'<th class="text-center ">服务器</th>'+
					'<th class="text-center warning">路径</th>'+
					'<th class="text-center ">操作</th>'+
				'</tr >';
	for(var index = 0; index <= length; index++) {
		box_.innerHTML += " <tr><td class='text-center info'>" + result.Data[index].MirId + "</td>" +
			"<td class='text-center '>" + result.Data[index].MerchantId + "</td>" +
			"<td class='text-center success'>" + result.Data[index].MirName + "</td>" +
			"<td class='text-center '>" + result.Data[index].Host + "</td>" +
			"<td class='text-center warning'>" + result.Data[index].Path + "</td>" +
			"<td class='text-center '>" +
			'<div class="btn-group" style="width: 80px;">'+
  					'<button type="button" class="btn btn-success">操作</button>	'+
  					'<button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">'+
    					'<span class="caret"></span>'+
   				    '<span class="sr-only">Toggle Dropdown</span>	'+
 					'</button>'+
 					'<ul class="dropdown-menu">'+
 				   '<li><a href="#">充值</a></li>'+
 				   '<li><a href="#" onclick="">检测</a></li>'+
 				   '<li><a href="#">编辑</a></li>'+
 				   '<li><a href="#" onclick="">加载 </a></li>'+
 				   '<li><a href="#" onclick="">克隆</a></li>'+
 				   '<li><a href="#">补发</a></li>'+
 				   '<li><a href="#">删除</a></li>'+
  				   '<li role="separator" class="divider"></li>'+
 				   '<li><a href="#">返回</a></li>'+
 				   '</ul>'+
			'</div>'+
			"</td></tr>"
	}
	}
},
error:function(el){
	$(".modal-body").html(el.responseText);
	$('#myModal').modal('show');
	box_.innerHTML = "请求数据时出错，请重试...";
}

})
}

//--------------------------------------------------------PayChannels方法--------------------------------------------------------

function PayChannels(){
	// var box = document.getElementById("myBox");
	// var text = document.getElementById("text");
	// var box_ = document.getElementById("myBox_1")

	box.innerHTML = "<img src='img/5-160914192R3.gif' style='width: 30%; margin-left: 35%;'/>";
	box_.innerHTML = "正在加载数据...";
	text.innerHTML = "共计 "+ 0 +" 条数据";
	
	
box.innerHTML += '<tr>'+
					 '<th class="text-center active">ALIPAY</th>'+
					 '<th class="text-center active">ALIPAYDiscounts</th> '+
					 '<th class="text-center">Bank</th>'+
					 '<th sortBy="age" class="text-center success">BankDiscount</th>'+
					 '<th class="text-center">BankFlag</th>'+
					 '<th class="text-center warning">ChannelName</th>'+
					 '<th class="text-center warning">Description</th> '+
					 '<th class="text-center warning">Digest</th>'+
					 '<th class="text-center active">DigestDiscounts</th>'+
					 '<th class="text-center">Id</th>'+
					 '<th class="text-center">IsSkipvt</th>'+
					 '<th class="text-center warning">MerchantId</th>'+
					 '<th class="text-center warning">PostUrl</th>'+
					 '<th class="text-center warning">QueryUrl</th>'+
					 '<th class="text-center warning">ServiceName</th>'+
					 '<th class="text-center warning">SignKey</th>'+
					 '<th class="text-center active">SkipvtUrl</th>'+
					 '<th class="text-center">SMS</th>'+
					 '<th class="text-center">SMSDiscounts</th>'+
					 '<th class="text-center warning">Status</th>'+
					 '<th class="text-center warning">TENPAY</th>'+
					 '<th class="text-center warning">TENPAYDiscounts</th>'+
				 '</tr> ';


//$.get("http://"+ location_ +"/Merchant/Pay/PayChannels", function(result) {
	$.ajax({
	 type:"POST",
	 url:APIHost +"/Merchant/Pay/PayChannels",
//	 beforeSend: function(data) {
//		//发送ajax请求之前向http的head里面加入验证信息
//      data.setRequestHeader("AccessToken", "123");
//  },
	 error:function(el){
		$(".modal-body").html(el.responseText);
		$('#myModal').modal('show');
		box_.innerHTML = "请求数据时出错，请重试...";
					},
	data:model,
	success:function(result){
	console.log(result.Data[0])
	if (result.Status != 1) {
		return alert(result.Message)
	}else{
		box.innerHTML = "";
		box_.innerHTML = "";
		var length = result.Data.length;
		text.innerHTML = "共计 "+ length +" 条数据"
	for(var index = 0; index <= length; index++) {
		var length = result.Data.length;
		text.innerHTML = "共计 "+ length +" 条数据"
		box_.innerHTML += 	" <tr><td class='text-center active'>" + result.Data[index].ALIPAY + "</td>" +
			"<td class='text-center '>" + result.Data[index].ALIPAYDiscounts + "</td>" +
			"<td class='text-center success'>" + result.Data[index].Bank + "</td>" +
			"<td class='text-center '>" + result.Data[index].BankDiscount + "</td>" +
			"<td class='text-center '>" + result.Data[index].BankFlag + "</td>" +
			"<td class='text-center '>" + result.Data[index].ChannelName + "</td>" +
			"<td class='text-center '>" + result.Data[index].Description + "</td>" +
			"<td class='text-center '>" + result.Data[index].Digest + "</td>" +
			"<td class='text-center success'>" + result.Data[index].DigestDiscounts + "</td>" +
			"<td class='text-center '>" + result.Data[index].Id + "</td>" +
			"<td class='text-center '>" + result.Data[index].IsSkipvt + "</td>" +
			"<td class='text-center '>" + result.Data[index].MerchantId + "</td>" +
			"<td class='text-center '>" + result.Data[index].PostUrl + "</td>" +
			"<td class='text-center '>" + result.Data[index].QueryUrl + "</td>" +
			"<td class='text-center '>" + result.Data[index].ServiceName + "</td>" +
			"<td class='text-center '>" + result.Data[index].SignKey + "</td>" +
			"<td class='text-center success'>" + result.Data[index].SkipvtUrl + "</td>" +
			"<td class='text-center '>" + result.Data[index].SMS + "</td>" +
			"<td class='text-center '>" + result.Data[index].SMSDiscounts + "</td>" +
			"<td class='text-center '>" + result.Data[index].Status + "</td>" +
			"<td class='text-center '>" + result.Data[index].TENPAY + "</td>" +
			"<td class='text-center '>" + result.Data[index].TENPAYDiscounts + "</td></tr>" 	
		}
	}
	}
})
}




//--------------------------------------------------------账号管理方法--------------------------------------------------------
		/*
		 * 转换  时间戳方法
		 */
		function time_(time){
		var FinalTime = time;
		//console.log(FinalTime)
		if (FinalTime != null) {
				time1 = FinalTime.substring(6,19) - 0;
				f_Date = new Date(time1);
				finalY = f_Date.getFullYear() + "-";
				finaM = (f_Date.getMonth() + 1< 10? "0" + (f_Date.getMonth()+1):f_Date.getMonth()+1) + "-";
				finaD = (f_Date.getDate()<10? "0"+f_Date.getDate(): f_Date.getDate()) + "/";
				finaH = (f_Date.getHours()<10? "0"+f_Date.getHours():f_Date.getHours())+ ":" ;
				fina_m = (f_Date.getMinutes()<10? "0"+f_Date.getMinutes():f_Date.getMinutes())+":";
				finaS = (f_Date.getSeconds()<10? "0"+f_Date.getSeconds():f_Date.getSeconds());
				return finalY + finaM + finaD + finaH + fina_m + finaS;
		} else{
		
			FinalTime = "未作修改"
		}
		}

//console.log(time_("/Date(1495438213553)/"))
function PayUser(){
	// var box = document.getElementById("myBox");
	// var text = document.getElementById("text");
	// var box_ = document.getElementById("myBox_1")

	box.innerHTML = "<img src='img/5-160914192R3.gif' style='width: 30%; margin-left: 35%;'/>";
	box_.innerHTML = "正在加载数据...";
	text.innerHTML = "共计 "+ 0 +" 条数据";
	
	


//$.get("http://"+ location_ +"/Merchant/Merchant/GetAccounts", function(result) {
	$.ajax({
	 type:"POST",
	 url:APIHost +"/Merchant/Merchant/GetAccounts",
	data:model,
	success:function(result){
//	console.log(result.Data[0])
	if (result.Status != 1) {
		return alert(result.Message)
	}else{
		box.innerHTML = "";
		box_.innerHTML = "";
		var length = result.Data.length;
		text.innerHTML = "共计 "+ length +" 条数据";
		box.innerHTML += '<tr>'+
					 '<th class="text-center active">AccountId</th>'+
//					 '<th class="text-center active">Account</th> '+
//					 '<th class="text-center">MerchantId</th>'+
//					 '<th sortBy="age" class="text-center success">MerchantName</th>'+
					 '<th class="text-center">PermissionGroupName</th>'+
					 '<th class="text-center">Duration</th>'+
					 '<th class="text-center">Integral</th> '+
					 '<th class="text-center">CreatedOn</th>'+
//					 '<th class="text-center active">CreatedBy</th>'+
					 '<th class="text-center">CheckinOn</th>'+
					 '<th class="text-center">CheckoutOn</th>'+
					 '<th class="text-center">ExpiredOn</th>'+
					 '<th class="text-center">IsLock</th>'+
					 '<th class="text-center">操作</th>'+
				 '</tr> ';

	for(var index = 0; index <= length; index++) {
		var result_ = result.Data[index];
		var CreatedOn = result_.CreatedOn;
		var CheckinOn = result_.CheckinOn;
		var CheckoutOn = result_.CheckoutOn;
		var ExpiredOn = result_.ExpiredOn;
		text.innerHTML = "共计 "+ length +" 条数据"
		box_.innerHTML += 	" <tr><td class='text-center active'>" + result.Data[index].AccountId + "</td>" +
//			"<td class='text-center '>" + result.Data[index].Account + "</td>" +
//			"<td class='text-center success'>" + result.Data[index].MerchantId + "</td>" +
//			"<td class='text-center '>" + result.Data[index].MerchantName + "</td>" +
			"<td class='text-center '>" + result.Data[index].PermissionGroupName + "</td>" +
			"<td class='text-center '>" + result.Data[index].Duration + "</td>" +
			"<td class='text-center '>" + result.Data[index].Integral + "</td>" +
			"<td class='text-center '>" +  time_(CreatedOn)  + "</td>" +
//			"<td class='text-center success'>" + result.Data[index].CreatedBy + "</td>" +
			"<td class='text-center '>" + time_(CheckinOn) + "</td>" +
			"<td class='text-center '>" + time_(CheckoutOn) + "</td>" +
			"<td class='text-center '>" + time_(ExpiredOn) + "</td>" +
			"<td class='text-center '>" + result.Data[index].IsLock + "</td>" +
			"<td class='text-center '>" + 
			'<div class="btn-group" style="width: 80px;">'+
  					'<button type="button" class="btn btn-success">操作</button>	'+
  					'<button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">'+
    					'<span class="caret"></span>'+
   				    '<span class="sr-only">Toggle Dropdown</span>	'+
 					'</button>'+
 					'<ul class="dropdown-menu">'+
 				   '<li><a href="#">禁用</a></li>'+
 				   '<li><a href="#">启用</a></li>'+
 				   '<li><a href="#">编辑</a></li>'+
// 				   '<li><a href="#">加载 </a></li>'+
// 				   '<li><a href="#">克隆</a></li>'+
// 				   '<li><a href="#">补发</a></li>'+
 				   '<li><a href="#">删除</a></li>'+
  				   '<li role="separator" class="divider"></li>'+
 				   '<li><a href="#">返回</a></li>'+
 				   '</ul>'+
			'</div>'+
//			"</td>" +
			"</td></tr>" 	
		}
	}
	},
	 error:function(el){
			$(".modal-body").html(el.responseText);
		$('#myModal').modal('show');
		box_.innerHTML = "请求数据时出错，请重试...";
					},
})
}


//--------------------------------------------------------加载方法--------------------------------------------------------
function Load(el){
	// var box = document.getElementById("myBox");
	// var text = document.getElementById("text");
	// var box_ = document.getElementById("myBox_1")

	box.innerHTML = "<img src='img/5-160914192R3.gif' style='width: 30%; margin-left: 35%;'/>";
	box_.innerHTML = "正在加载数据...";
	text.innerHTML = "共计 "+ 0 +" 条数据";

	console.log(el)
	console.log(model.AccessToken)
//	var model1 = model[0]
	$.ajax({
	type: "POST",
	url: APIHost +"Merchant/Servers/LoadNpc",
	data:{id: el,AccessToken:model.AccessToken},
	
	dataType:'json',
	success:function(data){
			if (data.Status != 1) {
				//失败状态
		return alert(data.Message)
	}else{
		//成功状态
		box.innerHTML = "";
		box_.innerHTML = "";
		console.log(data)
//		var length = data.Data.length;
//		text.innerHTML = "共计 "+ length +" 条数据"
//	for(var index = 0; index <= length; index++) {
//		
////		box_.innerHTML += 	" " ;	
//		}
	}

	},
	error:function(el){
	$(".modal-body").html(el.responseText);
		$('#myModal').modal('show');
		box_.innerHTML = "请求数据时出错，请重试...";
	}
	
	});
}


//--------------------------------------------------------检测方法--------------------------------------------------------
function Test(el){
	// var box = document.getElementById("myBox");
	// var text = document.getElementById("text");
	// var box_ = document.getElementById("myBox_1")

	box.innerHTML = "<img src='img/5-160914192R3.gif' style='width: 30%; margin-left: 35%;'/>";
	box_.innerHTML = "正在加载数据...";
	text.innerHTML = "共计 "+ 0 +" 条数据";

	console.log(el)
	console.log(model.AccessToken)
//	var model1 = model[0]
	$.ajax({
	type: "POST",
	url: APIHost +"Merchant/Servers/TestNpc",
	data:{id: el,AccessToken:model.AccessToken},
	
	dataType:'json',
	success:function(data){
			if (data.Status != 1) {
				//失败状态
		return alert(data.Message)
	}else{
		box.innerHTML = "";
		box_.innerHTML = "";
		//成功状态
		console.log(data)
//		var length = data.Data.length;
//		text.innerHTML = "共计 "+ length +" 条数据"
//	for(var index = 0; index <= length; index++) {
//		
////		box_.innerHTML += 	" " ;	
//		}
	}

	},
	error:function(el){
	$(".modal-body").html(el.responseText);
		$('#myModal').modal('show');
		box_.innerHTML = "请求数据时出错，请重试...";
	}
	
	});
}


//--------------------------------------------------------克隆方法--------------------------------------------------------
function Ghost(el){
	// var box = document.getElementById("myBox");
	// var text = document.getElementById("text");
	// var box_ = document.getElementById("myBox_1")

	box.innerHTML = "<img src='img/5-160914192R3.gif' style='width: 30%; margin-left: 35%;'/>";
	box_.innerHTML = "正在加载数据...";
	text.innerHTML = "共计 "+ 0 +" 条数据";

	console.log(el)
	console.log(model.AccessToken)
//	var model1 = model[0]
	$.ajax({
	type: "POST",
	url: APIHost +"/Merchant/Servers/Ghost",
	data:{id: el,AccessToken:model.AccessToken},
	
	dataType:'json',
	success:function(data){
			if (data.Status != 1) {
				//失败状态
		return alert(data.Message)
	}else{
		box.innerHTML = "";
		box_.innerHTML = "";
		//成功状态
		console.log(data)
//		var length = data.Data.length;
//		text.innerHTML = "共计 "+ length +" 条数据"
//	for(var index = 0; index <= length; index++) {
//		
////		box_.innerHTML += 	" " ;	
//		}
	}

	},
	error:function(el){
	$(".modal-body").html(el.responseText);
		$('#myModal').modal('show');	
		box_.innerHTML = "请求数据时出错，请重试...";
}
	
	});
}


//--------------------------------------------------------退出登录方法--------------------------------------------------------
function CheckOut(el){
	// var box = document.getElementById("myBox");
	// var text = document.getElementById("text");
	// var box_ = document.getElementById("myBox_1")

	box.innerHTML = "<img src='img/5-160914192R3.gif' style='width: 30%; margin-left: 35%;'/>";
	box_.innerHTML = "正在加载数据...";
	text.innerHTML = "共计 "+ 0 +" 条数据";

	console.log(el)
	console.log(model.AccessToken)
	$.ajax({
	type: "POST",
	url: APIHost +"/Merchant/Passport/CheckOut",
	data:{id: el,AccessToken:model.AccessToken},
	dataType:'json',
	success:function(data){
			if (data.Status == 1) {
				//成功状态
				$(".modal-body").html("已安全退出登录！2秒后跳转...");
				$('#myModal').modal('show');	
				
				deCookie("Account");
				deCookie("MerchantName");
				deCookie("GroupName");
				deCookie("AccessToken");
				setTimeout("window.location.href = 'SignIn.html'",1500);
				
//				function location_(){
////					window.location.href = "SignIn.html";
//					alert("www")
//				}
		}
	},
	error:function(el){
		$(".modal-body").html('退出失败，请重试');
		$('#myModal').modal('show');	
//		window.location.href = "SignIn.html";
	}
		
	});
}


//----------------------------------------------------页首跑马灯效果方法------------------------------------------------------
function Ghost(){
	// var box = document.getElementById("myBox");
	// var text = document.getElementById("text");
	// var box_ = document.getElementById("myBox_1")

	// box.innerHTML = "";
	// box_.innerHTML = "";
	// text.innerHTML = "共计 "+ 0 +" 条数据";

	// console.log(el)
	// console.log(model.AccessToken)
//	var model1 = model[0]
	$.ajax({
	type: "POST",
	url: APIHost +"/Merchant/Announcement/Items",
	data:model,
	
	dataType:'json',
	success:function(data){
			if (data.Status != 1) {
				//失败状态
		return alert(data.Message)
	}else{
		//成功状态
		console.log(data.Data);
		var length = data.Data.length;
		var prompt = document.getElementById("prompt")
		console.log(length);
		for(var i = 0;i<=10;i++ ){
			var Title = data.Data[i].Title;
			var i_ = i+1;
			prompt.innerHTML += "<span style='margin-right: 250px;'>"+ i_ + " , " +  Title +"</span>";
		}
		
//		var length = data.Data.length;
//		text.innerHTML = "共计 "+ length +" 条数据"
//	for(var index = 0; index <= length; index++) {
//		
////		box_.innerHTML += 	" " ;	
//		}
	}

	},
	error:function(el){
	$(".modal-body").html(el.responseText);
		$('#myModal').modal('show');	}
	
	});
}

//----------------------------------------------------系统设置-支付渠道方法------------------------------------------------------
function products(){
	// var box = document.getElementById("myBox");
	// var text = document.getElementById("text");
	// var box_ = document.getElementById("myBox_1")

	box.innerHTML = "<img src='img/5-160914192R3.gif' style='width: 30%; margin-left: 35%;'/>";
	box_.innerHTML = "正在加载数据...";
	text.innerHTML = "共计 "+ 0 +" 条数据";
	
	// box.innerHTML += '<tr> '+
	// 				 '<th class="text-center active">BusinessType</th>'+
	// 				 '<th class="text-center">ChannelId</th>'+
	// 				 '<th sortBy="age" class="text-center success">FaceValue</th>'+
	// 				 '<th class="text-center">MerchantId</th>'+
	// 				 '<th class="text-center warning">ProductId</th>'+
	// 				 '<th sortBy="age" class="text-center success">ProductName</th>'+
	// 				 '<th class="text-center">ProductNo</th>'+
	// 				 '<th class="text-center warning">Status</th>'+
	// 			 '</tr>'

//$.get("http://"+ location_ +"/Merchant/Domain/Grouplist", function(result) {
	$.ajax({
	 type:"POST",
	 url:APIHost +"/Merchant/Product/Products",
//	 beforeSend: function(data) {
//		//发送ajax请求之前向http的head里面加入验证信息
//      data.setRequestHeader("AccessToken", "123");
//  },
	 error:function(el){
		$(".modal-body").html(el.responseText);
		$('#myModal').modal('show');
		box_.innerHTML = "请求数据时出错，请重试...";
					},
	data:model,
	success:function(result){
	if (result.Status != 1) {
		return alert(result.Message)
	}else{
		box.innerHTML = "";
		box_.innerHTML = "";
		var length = result.Data.length;
		console.log(result.Data[0]);
		console.log(length)
		text.innerHTML = "共计 "+ length +" 条数据";
		
		
		box.innerHTML += '<tr>'+
					'<th class="text-center active">BusinessType</th>'+
					'<th class="text-center">ChannelId</th>'+
					'<th sortBy="age" class="text-center success">FaceValue</th>'+
					'<th class="text-center">MerchantId</th>'+
					'<th class="text-center warning">ProductId</th>'+
					'<th sortBy="age" class="text-center success">ProductName</th>'+
					'<th class="text-center">ProductNo</th>'+
					'<th class="text-center warning">Status</th>'+
				'</tr>';
		
		for(var index = 0; index <= length; index++) {
		box_.innerHTML += 	" <tr><td class='text-center active'>" + result.Data[index].BusinessType + "</td>" +
			"<td class='text-center '>" + result.Data[index].ChannelId + "</td>" +
			"<td class='text-center success'>" + result.Data[index].FaceValue + "</td>" +
			"<td class='text-center '>" + result.Data[index].MerchantId + "</td>" +
			"<td class='text-center '>" + result.Data[index].ProductId + "</td>" +
			"<td class='text-center success'>" + result.Data[index].ProductName + "</td>" +
			"<td class='text-center '>" + result.Data[index].ProductNo + "</td>" +
			"<td class='text-center danger'>" + result.Data[index].Status + "</td></tr>"	
	}
	}
}
})
}

//----------------------------------------------------系统设置-通讯密钥方法------------------------------------------------------
function channels(){
	// var box = document.getElementById("myBox");
	// var text = document.getElementById("text");
	// var box_ = document.getElementById("myBox_1")

	box.innerHTML = "<img src='img/5-160914192R3.gif' style='width: 30%; margin-left: 35%;'/>";
	box_.innerHTML = "正在加载数据...";
	text.innerHTML = "共计 "+ 0 +" 条数据";
	
	// box.innerHTML += '<tr> '+
	// 				 '<th class="text-center active">BusinessType</th>'+
	// 				 '<th class="text-center">ChannelId</th>'+
	// 				 '<th sortBy="age" class="text-center success">FaceValue</th>'+
	// 				 '<th class="text-center">MerchantId</th>'+
	// 				 '<th class="text-center warning">ProductId</th>'+
	// 				 '<th sortBy="age" class="text-center success">ProductName</th>'+
	// 				 '<th class="text-center">ProductNo</th>'+
	// 				 '<th class="text-center warning">Status</th>'+
	// 			 '</tr>'

//$.get("http://"+ location_ +"/Merchant/Domain/Grouplist", function(result) {
	$.ajax({
	 type:"POST",
	 url:APIHost+"/Merchant/Pay/Channels",
//	 beforeSend: function(data) {
//		//发送ajax请求之前向http的head里面加入验证信息
//      data.setRequestHeader("AccessToken", "123");
//  },
	 error:function(el){
		$(".modal-body").html(el.responseText);
		$('#myModal').modal('show');
		box_.innerHTML = "请求数据时出错，请重试...";
					},
	data:model,
	success:function(result){
	if (result.Status != 1) {
		return alert(result.Message)
	}else{
		box.innerHTML = "";
		box_.innerHTML = "";
		var length = result.Data.length;
		console.log(result.Data[0]);
		console.log(length)
		text.innerHTML = "共计 "+ length +" 条数据";
		
		
		box.innerHTML += '<tr>'+
					'<th class="text-center active">ALIPAY</th>'+
					'<th class="text-center">ALIPAYDiscounts</th>'+
					'<th sortBy="age" class="text-center success">Bank</th>'+
					'<th class="text-center">BankDiscount</th>'+
					'<th class="text-center warning">BankFlag</th>'+
					'<th sortBy="age" class="text-center success">ChannelName</th>'+
					'<th class="text-center">Description</th>'+
					'<th class="text-center warning">Digest</th>'+
					'<th class="text-center active">DigestDiscounts</th>'+
					'<th class="text-center">Id</th>'+
					'<th sortBy="age" class="text-center success">IsSkipvt</th>'+
					'<th class="text-center">MerchantId</th>'+
					'<th class="text-center warning">warning</th>'+
					'<th sortBy="age" class="text-center success">QueryUrl</th>'+
					'<th class="text-center">SMS</th>'+
					'<th class="text-center warning">SMSDiscounts</th>'+
					'<th class="text-center active">ServiceName</th>'+
					'<th class="text-center">SignKey</th>'+
					'<th sortBy="age" class="text-center success">SkipvtUrl</th>'+
					'<th class="text-center">Status</th>'+
					'<th class="text-center warning">TENPAY</th>'+
					'<th sortBy="age" class="text-center success">TENPAYDiscounts</th>'+
				'</tr>';
		
		for(var index = 0; index <= length; index++) {
		box_.innerHTML += 	
			"<tr><td class='text-center active'>" + result.Data[index].ALIPAY + "</td>" +
			"<td class='text-center '>" + result.Data[index].ALIPAYDiscounts + "</td>" +
			"<td class='text-center success'>" + result.Data[index].Bank + "</td>" +
			"<td class='text-center '>" + result.Data[index].BankDiscount + "</td>" +
			"<td class='text-center '>" + result.Data[index].BankFlag + "</td>" +
			"<td class='text-center success'>" + result.Data[index].ChannelName + "</td>" +
			"<td class='text-center '>" + result.Data[index].Description + "</td>" +
			"<td class='text-center danger'>" + result.Data[index].Digest + "</td>"+
			"<td class='text-center active'>" + result.Data[index].DigestDiscounts + "</td>" +
			"<td class='text-center '>" + result.Data[index].Id + "</td>" +
			"<td class='text-center success'>" + result.Data[index].IsSkipvt + "</td>" +
			"<td class='text-center '>" + result.Data[index].MerchantId + "</td>" +
			"<td class='text-center '>" + result.Data[index].warning + "</td>" +
			"<td class='text-center success'>" + result.Data[index].QueryUrl + "</td>" +
			"<td class='text-center '>" + result.Data[index].SMS + "</td>" +
			"<td class='text-center danger'>" + result.Data[index].SMSDiscounts + "</td>"+	
			"<td class='text-center active'>" + result.Data[index].ServiceName + "</td>" +
			"<td class='text-center '>" + result.Data[index].SignKey + "</td>" +
			"<td class='text-center success'>" + result.Data[index].SkipvtUrl + "</td>" +
			"<td class='text-center '>" + result.Data[index].Status + "</td>" +
			"<td class='text-center '>" + result.Data[index].TENPAY + "</td>" +
			"<td class='text-center success'>" + result.Data[index].TENPAYDiscounts + "</td>" +
			"</tr>"
	}
	}
}
})
}

//----------------------------------------------------分区管理-分区模板方法------------------------------------------------------
// function template(){
	
// 	box.innerHTML = "<img src='img/5-160914192R3.gif' style='width: 50%; margin-left: 25%;box-shadow: 0 0 25px rgb(2,23,36);'/>";
// 	box_.innerHTML = "正在加载数据...";
	// text.innerHTML = "共计 "+ 0 +" 条数据";
	
	// box.innerHTML += '<tr> '+
	// 				 '<th class="text-center active">BusinessType</th>'+
	// 				 '<th class="text-center">ChannelId</th>'+
	// 				 '<th sortBy="age" class="text-center success">FaceValue</th>'+
	// 				 '<th class="text-center">MerchantId</th>'+
	// 				 '<th class="text-center warning">ProductId</th>'+
	// 				 '<th sortBy="age" class="text-center success">ProductName</th>'+
	// 				 '<th class="text-center">ProductNo</th>'+
	// 				 '<th class="text-center warning">Status</th>'+
	// 			 '</tr>'

//$.get("http://"+ location_ +"/Merchant/Domain/Grouplist", function(result) {
	// $.ajax({
	//  type:"POST",
	//  url:APIHost+"/Merchant/Pay/Channels",
//	 beforeSend: function(data) {
//		//发送ajax请求之前向http的head里面加入验证信息
//      data.setRequestHeader("AccessToken", "123");
//  },
	//  error:function(el){
	// 	$(".modal-body").html(el.responseText);
	// 	$('#myModal').modal('show');
	// 	box_.innerHTML = "请求数据时出错，请重试...";
	// 				},
	// data:model,
	// success:function(result){
	// if (result.Status != 1) {
	// 	return alert(result.Message)
	// }else{
		// box.innerHTML = "";
		// box_.innerHTML = "";
		// var length = result.Data.length;
		// console.log(result.Data[0]);
		// console.log(length)
		// text.innerHTML = "共计 "+ length +" 条数据";
		
		
		// box.innerHTML += '<tr>'+
		// 			'<th class="text-center active">ALIPAY</th>'+
		// 			'<th class="text-center">ALIPAYDiscounts</th>'+
		// 			'<th sortBy="age" class="text-center success">Bank</th>'+
		// 			'<th class="text-center">BankDiscount</th>'+
		// 			'<th class="text-center warning">BankFlag</th>'+
		// 			'<th sortBy="age" class="text-center success">ChannelName</th>'+
		// 			'<th class="text-center">Description</th>'+
		// 			'<th class="text-center warning">Digest</th>'+
		// 			'<th class="text-center active">DigestDiscounts</th>'+
		// 			'<th class="text-center">Id</th>'+
		// 			'<th sortBy="age" class="text-center success">IsSkipvt</th>'+
		// 			'<th class="text-center">MerchantId</th>'+
		// 			'<th class="text-center warning">warning</th>'+
		// 			'<th sortBy="age" class="text-center success">QueryUrl</th>'+
		// 			'<th class="text-center">SMS</th>'+
		// 			'<th class="text-center warning">SMSDiscounts</th>'+
		// 			'<th class="text-center active">ServiceName</th>'+
		// 			'<th class="text-center">SignKey</th>'+
		// 			'<th sortBy="age" class="text-center success">SkipvtUrl</th>'+
		// 			'<th class="text-center">Status</th>'+
		// 			'<th class="text-center warning">TENPAY</th>'+
		// 			'<th sortBy="age" class="text-center success">TENPAYDiscounts</th>'+
		// 		'</tr>';
		
		// for(var index = 0; index <= length; index++) {
		// box_.innerHTML += 	
			// "<tr><td class='text-center active'>" + result.Data[index].ALIPAY + "</td>" +
			// "<td class='text-center '>" + result.Data[index].ALIPAYDiscounts + "</td>" +
			// "<td class='text-center success'>" + result.Data[index].Bank + "</td>" +
			// "<td class='text-center '>" + result.Data[index].BankDiscount + "</td>" +
			// "<td class='text-center '>" + result.Data[index].BankFlag + "</td>" +
			// "<td class='text-center success'>" + result.Data[index].ChannelName + "</td>" +
			// "<td class='text-center '>" + result.Data[index].Description + "</td>" +
			// "<td class='text-center danger'>" + result.Data[index].Digest + "</td>"+
			// "<td class='text-center active'>" + result.Data[index].DigestDiscounts + "</td>" +
			// "<td class='text-center '>" + result.Data[index].Id + "</td>" +
			// "<td class='text-center success'>" + result.Data[index].IsSkipvt + "</td>" +
			// "<td class='text-center '>" + result.Data[index].MerchantId + "</td>" +
			// "<td class='text-center '>" + result.Data[index].warning + "</td>" +
			// "<td class='text-center success'>" + result.Data[index].QueryUrl + "</td>" +
			// "<td class='text-center '>" + result.Data[index].SMS + "</td>" +
			// "<td class='text-center danger'>" + result.Data[index].SMSDiscounts + "</td>"+	
			// "<td class='text-center active'>" + result.Data[index].ServiceName + "</td>" +
			// "<td class='text-center '>" + result.Data[index].SignKey + "</td>" +
			// "<td class='text-center success'>" + result.Data[index].SkipvtUrl + "</td>" +
			// "<td class='text-center '>" + result.Data[index].Status + "</td>" +
			// "<td class='text-center '>" + result.Data[index].TENPAY + "</td>" +
			// "<td class='text-center success'>" + result.Data[index].TENPAYDiscounts + "</td>" +
			// "</tr>"

// 			 '<div class="page-content">'+
//        ' <div class="content">'+
//            ' <form action="/masters/create/cq" method="post"><input id="game" name="game" type="hidden" value="CQ" /><input id="id" type="hidden" value="0" />'+
//     '<div class="node-body">'+
//         '<h2 style="font-weight: 300;">热血传奇兑换模板</h2>'+
//         '<div class="node">'+
//             '<div class="node-header" onclick="showinner(this)">基础配置<span class="open"></span></div>'+
//             '<div class="inner">'+
//               '<table>'+
//                    ' <tr><th>模板名称：</th><td><input class="form-control" id="Name" name="Name" type="text" value="" /> 5-16个字，请勿输入特殊符号</td></tr>'+
//                     '<tr><th>游戏币：</th><td><ul class="list"><li><input checked="checked" cmd="GAMEGOLD +" id="Glod" name="Glod" text="元宝" type="radio" value="1" /> 元宝</li><li><input cmd="give 金币" id="Glod" name="Glod" text="金币" type="radio" value="2" /> 金币</li><li><input cmd="" id="Glod" name="Glod" text="自定义" type="radio" value="0" /> 自定义</li></ul></td></tr>'+
//                     '<tr><th>游戏币名称：</th><td><input class="form-control" id="Unit" maxlength="16" name="Unit" style="width:80px" type="text" value="元宝" /> 脚本命令：<input class="form-control" id="Command" maxlength="18" name="Command" type="text" value="GAMEGOLD +" /></td></tr>'+
//                     '<tr><th>兑换比例：</th><td><input class="form-control" id="Scale" maxlength="8" name="Scale" style="width:80px" type="text" value="1" /> 1元人民币可以兑换的游戏币数量</td></tr>'+
//                 '</table>'+
//                 '<br />'+
//                 '<table class="Npc">'+
//                     '<tr><th>NPC名称：</th><td><input class="form-control" id="NpcName" maxlength="18" name="NpcName" type="text" value="元宝充值使者" /> 游戏安全区NPC名称</td></tr>'+
//                         '<tr><th>地图：</th><td><input class="form-control" id="Map" maxlength="8" name="Map" size="5" type="text" value="3" /> X：<input class="form-control" id="X" maxlength="8" name="X" size="5" type="text" value="343" /> Y：<input class="form-control" id="Y" maxlength="8" name="Y" size="5" type="text" value="338" /> 外观：<input class="form-control" id="S" maxlength="8" name="S" size="5" type="text" value="12" /> <input type="button" value="删除" class="btn btn-danger" onclick="RemoveNpc(this)" /></td></tr>'+
//                         '<tr><th>地图：</th><td><input class="form-control" id="Map" maxlength="8" name="Map" size="5" type="text" value="0" /> X：<input class="form-control" id="X" maxlength="8" name="X" size="5" type="text" value="332" /> Y：<input class="form-control" id="Y" maxlength="8" name="Y" size="5" type="text" value="264" /> 外观：<input class="form-control" id="S" maxlength="8" name="S" size="5" type="text" value="12" /> <input type="button" value="删除" class="btn btn-danger" onclick="RemoveNpc(this)" /></td></tr>'+
//                     '<tr><th>地图：</th><td><input class="form-control" id="Map" maxlength="8" name="Map" size="5" type="text" value="" /> X：<input class="form-control" id="X" maxlength="8" name="X" size="5" type="text" value="" /> Y：<input class="form-control" id="Y" maxlength="8" name="Y" size="5" type="text" value="" /> 外观：<input class="form-control" id="S" maxlength="8" name="S" size="5" type="text" value="" /> <input type="button" value="删除" class="btn btn-danger" onclick="RemoveNpc(this)" /></td></tr>'+
//                     '<tr><th></th><td><input type="button" value="添加" class="btn btn-green" onclick="insertNpc()" /></td></tr>'+
//                 '</table>'+
//                 '<br />'+
//                 '<table>'+
//                     '<tr><th>游戏引擎：</th><td><select class="form-control" id="EngineName" name="EngineName" onchange="Selengine()" style="width:180px;"><option value="">选择引擎</option>'+
// '<option value="Herom2">Herom2</option>'+
// '<option value="3KM2">3KM2</option>'+
// '<option value="Bluem2/Legendm2">Bluem2/Legendm2</option>'+
// '<option value="Gameofmir">Gameofmir</option>'+
// '<option value="GEE">GEE</option>'+
// '<option value="MaxM2">MaxM2</option>'+
// '<option value="其它">其它</option>'+
// '</select></td></tr>'+
//                     '<tr><th>浏览器指令：</th><td><input class="form-control" id="EngineCommand" maxlength="18" name="EngineCommand" style="width:180px;" type="text" value="" /></td></tr>'+
//                     '<tr><th>&nbsp;</th><td>不同的引擎打开浏览器的指令可能有差异，请查阅相关帮助文档</td></tr>'+
//                 '</table>'+
//             '</div>'+
//         '</div>'+
//        ' <div class="node">'+
//            ' <div class="node-header" onclick="showinner(this)">附加赠送<span class="close"></span></div>'+
//             '<div class="inner">'+
//                ' <table>'+
//                    ' <tr><th>设置：</th><td colspan="3"><span><input name="ShowAttached" type="checkbox" value="1" /> 充值时显示附加赠送</span></td></tr>'+
//                     '<tr><th>选项：</th><td colspan="3"><ul class="list"><li><input checked="checked" id="AddonFlag" name="AddonFlag" type="radio" value="0" /> 无</li><li><input id="AddonFlag" name="AddonFlag" type="radio" value="1" /> 按充值金额计算</li><li><input id="AddonFlag" name="AddonFlag" type="radio" value="3" /> 充值金额+渠道赠送</li><li><input id="AddonFlag" name="AddonFlag" type="radio" value="4" /> 充值金额+激励赠送</li><li><input id="AddonFlag" name="AddonFlag" type="radio" value="2" /> 充值金额+渠道赠送+激励赠送</li></ul></td></tr>'+
//                    ' <tr><th>&nbsp;</th><td>赠送物品</td><td>脚本命令</td><td>赠送比例</td></tr>'+
//                         '<tr><th>&nbsp;</th><td><input class="form-control" id="AddonName" maxlength="18" name="AddonName" type="text" value="金刚石" /></td><td><input class="form-control" id="AddonCommand" maxlength="28" name="AddonCommand" size="30" type="text" value="GAMEDIAMOND + " /></td><td><input class="form-control" id="AddonScale" maxlength="8" name="AddonScale" style="width:80px" type="text" value="" /></td></tr>'+
//                         '<tr><th>&nbsp;</th><td><input class="form-control" id="AddonName" maxlength="18" name="AddonName" type="text" value="荣誉点" /></td><td><input class="form-control" id="AddonCommand" maxlength="28" name="AddonCommand" size="30" type="text" value="CHANGEGLORY + " /></td><td><input class="form-control" id="AddonScale" maxlength="8" name="AddonScale" style="width:80px" type="text" value="" /></td></tr>'+
//                         '<tr><th>&nbsp;</th><td><input class="form-control" id="AddonName" maxlength="18" name="AddonName" type="text" value="游戏点" /></td><td><input class="form-control" id="AddonCommand" maxlength="28" name="AddonCommand" size="30" type="text" value="GAMEPOINT + " /></td><td><input class="form-control" id="AddonScale" maxlength="8" name="AddonScale" style="width:80px" type="text" value="" /></td></tr>'+
//                         '<tr><th>&nbsp;</th><td><input class="form-control" id="AddonName" maxlength="18" name="AddonName" type="text" value="灵符" /></td><td><input class="form-control" id="AddonCommand" maxlength="28" name="AddonCommand" size="30" type="text" value="GAMEGIRD + " /></td><td><input class="form-control" id="AddonScale" maxlength="8" name="AddonScale" style="width:80px" type="text" value="" /></td></tr>'+
//                         '<tr><th>&nbsp;</th><td><input class="form-control" id="AddonName" maxlength="18" name="AddonName" type="text" value="声望" /></td><td><input class="form-control" id="AddonCommand" maxlength="28" name="AddonCommand" size="30" type="text" value="CREDITPOINT + " /></td><td><input class="form-control" id="AddonScale" maxlength="8" name="AddonScale" style="width:80px" type="text" value="" /></td></tr>'+
//                 '</table>'+
//             '</div>'+
//         '</div>'+
//         '<div class="node">'+
//             '<div class="node-header" onclick="showinner(this)">积分设置<span class="close"></span></div>'+
//             '<div class="inner">'+
//                 '<table class="integral">'+
//                     '<tr><th>设置：</th><td colspan="4"><span><input name="ShowIntegral" type="checkbox" value="1" /> 充值时显示积分赠送</span></td></tr>'+
//                     '<tr><th>选项：</th><td colspan="4"><ul class="list"><li><input checked="checked" id="IntegralFlag" name="IntegralFlag" type="radio" value="0" /> 无</li><li><input id="IntegralFlag" name="IntegralFlag" type="radio" value="1" /> 按充值金额计算</li><li><input id="IntegralFlag" name="IntegralFlag" type="radio" value="3" /> 充值金额+渠道赠送</li><li><input id="IntegralFlag" name="IntegralFlag" type="radio" value="4" /> 充值金额+激励赠送</li><li><input id="IntegralFlag" name="IntegralFlag" type="radio" value="2" /> 充值金额+渠道赠送+激励赠送</li></ul></td></tr>'+
//                     '<tr><th></th><td>积分名称</td><td style="width:60px; text-align:center">显示</td><td>积分文件</td><td>赠送比例</td></tr>'+
//                         '<tr><th>变量：</th><td><input class="form-control" id="VarName" maxlength="18" name="VarName" style="width:80px;" type="text" value="消费积分" /></td><td style="width:60px; text-align:center"><input type="checkbox" checked="checked" onclick="Changed(this)" /><input id="showMsg" type="hidden" name="showMsg" value="1" /></td><td><input class="form-control" id="VarPath" maxlength="60" name="VarPath" style="width:300px;" type="text" value="..\QuestDiary\充值积分\消费积分Save.txt" /></td><td><input class="form-control" id="IntegralScale" maxlength="8" name="IntegralScale" style="width:80px;" type="text" value="1" /> <input type="button" value="删除" class="btn btn-green" onclick="deleteIntegralrow(this)" /></td></tr>'+
//                         '<tr><th>变量：</th><td><input class="form-control" id="VarName" maxlength="18" name="VarName" style="width:80px;" type="text" value="元宝消费" /></td><td style="width:60px; text-align:center"><input type="checkbox" checked="checked" onclick="Changed(this)" /><input id="showMsg" type="hidden" name="showMsg" value="1" /></td><td><input class="form-control" id="VarPath" maxlength="60" name="VarPath" style="width:300px;" type="text" value="..\QuestDiary\充值积分\元宝消费Save.txt" /></td><td><input class="form-control" id="IntegralScale" maxlength="8" name="IntegralScale" style="width:80px;" type="text" value="1" /> <input type="button" value="删除" class="btn btn-green" onclick="deleteIntegralrow(this)" /></td></tr>'+
//                     '<tr><th>变量：</th><td><input class="form-control" id="VarName" maxlength="18" name="VarName" style="width:80px;" type="text" value="" /></td><td style="width:60px; text-align:center"><input type="checkbox" onclick="Changed(this)" /><input type="hidden" name="showMsg" value="0" /></td><td><input class="form-control" id="VarPath" maxlength="60" name="VarPath" style="width:300px;" type="text" value="" /></td><td><input class="form-control" id="IntegralScale" maxlength="8" name="IntegralScale" style="width:80px;" type="text" value="" /> <input type="button" value="删除" class="btn btn-green" onclick="deleteIntegralrow(this)" /></td></tr>'+
//                     '<tfoot><tr><th>&nbsp;</th><td colspan="3"><input type="button" value="添加" class="btn btn-danger" onclick="insertIntegral()" /></td></tr></tfoot>'+
//                 '</table>'+
//             '</div>'+
//         '</div>'+
//        ' <div class="node">'+
//             '<div class="node-header" onclick="showinner(this)">装备赠送<span class="close"></span></div>'+
//             '<div class="inner">'+
//                ' <table>'+
//                    ' <tr><th>设置：</th><td><span><input name="ShowMagic" type="checkbox" value="1" /> 充值时显示装备赠送</span></td></tr>'+
//                    ' <tr><th>选项：</th><td><ul class="list"><li><input checked="checked" id="MagicFlag" name="MagicFlag" type="radio" value="0" /> 无</li><li><input id="MagicFlag" name="MagicFlag" type="radio" value="1" /> 按充值金额计算</li><li><input id="MagicFlag" name="MagicFlag" type="radio" value="3" /> 充值金额+渠道赠送</li><li><input id="MagicFlag" name="MagicFlag" type="radio" value="4" /> 充值金额+激励赠送</li><li><input id="MagicFlag" name="MagicFlag" type="radio" value="2" /> 充值金额+渠道赠送+激励赠送</li></ul></td></tr>'+
//                 '</table>'+
//                 '<table class="magic">'+
//                     '<tr><th>&nbsp;</th><td colspan="3"><span style=" color:red;">温馨提示:如需赠送多个装备,装备之间请用"+"分隔.例如:回城券+传送戒指</span></td></tr>'+
//                     '<tr><th>&nbsp;</th><td>金额(元)</td><td>脚本命令</td><td>赠送装备(输入装备和数量)</td></tr>'+
//                     '<tr><th>充值：</th><td><input class="form-control" id="MagicMoney" maxlength="8" name="MagicMoney" style="width:80px;" type="text" value="" /></td><td><input class="form-control" id="MagicCmd" maxlength="28" name="MagicCmd" style="width:80px;" type="text" value="Give" /></td><td><input class="form-control" id="MagicName" maxlength="28" name="MagicName" size="30" type="text" value="" /> <input type="button" value="删除" class="btn btn-green" onclick="removemagic(this)" /></td></tr>'+
//                     '<tfoot><tr><th>&nbsp;</th><td colspan="3"><input type="button" value="添加" class="btn btn-danger" onclick="addmagic()" /></td></tr></tfoot>'+
//                 '</table>'+
//             '</div>'+
//         '</div>'+
//         '<div class="node">'+
//            ' <div class="node-header" onclick="showinner(this)">激励赠送<span class="close"></span></div>'+
//             '<div id="recharge-div" class="inner">'+
//                 '<table class="encourage">'+
//                     '<tr><th>选项：</th><td colspan="2"><input name="EncourageFlag" type="checkbox" value="1" /> 渠道赠送包含激励赠送金额</td></tr>'+
//                    ' <tr><th>&nbsp;</th><td>金额(元)</td><td>赠送金额(元)</td></tr>'+
//                     '<tr><th>充值：</th><td><input class="form-control" id="PayMoney" name="PayMoney" style="width:80px;" type="text" value="" /></td><td><input class="form-control" id="GiveMoney" name="GiveMoney" style="width:80px;" type="text" value="" /> <input type="button" value="删除" class="btn btn-green" onclick="removencourage(this)" /></td></tr>'+
//                     '<tfoot><tr><th>&nbsp;</th><td colspan="2"><input type="button" value="添加" class="btn btn-danger" onclick="addencourage()" /></td></tr></tfoot>'+
//                 '</table>'+
//             '</div>'+
//         '</div> '+ 
//         '<div class="node">'+
//             '<div class="node-header" onclick="showinner(this)">充值渠道<span class="open"></span></div>'+
//             '<div class="inner">'+
//     '<table>'+
//         '<tr><th>选项：</th><td><ul class="list"><li><input name="ChannelFlag" type="checkbox" checked value="1" /> 开启充值赠送</li><li><input name="DigestOpt" type="checkbox"  value="1" /> 关闭点卡充值</li></ul></td></tr>'+
//     '</table>'+
//     '<table>'+
//         '<tr><th>网银赠送比例</th><td><input type="text" style="width:60px" onkeyup="setdiscount(this, "BankScale")" placeholder="赠送" class="form-control" /> <i>百分比(%)</i></td></tr>'+
//     '</table>'+
//     '<table>'+

//            ' <tr>'+
//                         '<th>网上银行：</th>'+
//                        ' <td><input class="form-control BankScale" id="BankScale_100" name="BankScale_100" style="width:60px" type="text" value="80" /></td>'+
//                         '<th>支付宝：</th>'+
//                         '<td><input class="form-control BankScale" id="BankScale_101" name="BankScale_101" style="width:60px" type="text" value="80" /></td>'+
//                         '<th>财付通：</th>'+
//                         '<td><input class="form-control BankScale" id="BankScale_102" name="BankScale_102" style="width:60px" type="text" value="80" /></td>'+
//                         '<th>微信：</th>'+
//                         '<td><input class="form-control BankScale" id="BankScale_103" name="BankScale_103" style="width:60px" type="text" value="80" /></td>'+
//                         '<th>&nbsp;</th>'+
//                         '<td>&nbsp;</td>'+
//            ' </tr>'+
//     '</table>'+
//     '<br />    '+
//     '<table>'+
//         '<tr><th>点卡赠送比例</th><td><input type="text" style="width:60px" onkeyup="setdiscount(this, "DigestSale")" placeholder="赠送" class="form-control" /> <i>百分比(%)</i></td></tr>'+
//     '</table>'+
//     '<table>'+

//            ' <tr>'+
//                        ' <th>骏网：</th>'+
//                         '<td><input class="form-control DigestSale" id="DigestSale_200" name="DigestSale_200" style="width:60px" type="text" value="80" /></td>'+
//                         '<th>盛大卡：</th>'+
//                         '<td><input class="form-control DigestSale" id="DigestSale_201" name="DigestSale_201" style="width:60px" type="text" value="80" /></td>'+
//                         '<th>征途：</th>'+
//                         '<td><input class="form-control DigestSale" id="DigestSale_202" name="DigestSale_202" style="width:60px" type="text" value="80" /></td>'+
//                         '<th>Q币：</th>'+
//                         '<td><input class="form-control DigestSale" id="DigestSale_203" name="DigestSale_203" style="width:60px" type="text" value="80" /></td>'+
//                         '<th>久游：</th>'+
//                         '<td><input class="form-control DigestSale" id="DigestSale_204" name="DigestSale_204" style="width:60px" type="text" value="80" /></td>'+
//             '</tr>'+
//             '<tr>'+
//                        ' <th>网易卡：</th>'+
//                         '<td><input class="form-control DigestSale" id="DigestSale_205" name="DigestSale_205" style="width:60px" type="text" value="80" /></td>'+
//                         '<th>完美卡：</th>'+
//                         '<td><input class="form-control DigestSale" id="DigestSale_206" name="DigestSale_206" style="width:60px" type="text" value="80" /></td>'+
//                         '<th>搜狐卡：</th>'+
//                         '<td><input class="form-control DigestSale" id="DigestSale_207" name="DigestSale_207" style="width:60px" type="text" value="80" /></td>'+
//                         '<th>纵游：</th>'+
//                         '<td><input class="form-control DigestSale" id="DigestSale_208" name="DigestSale_208" style="width:60px" type="text" value="80" /></td>'+
//                         '<th>天宏卡：</th>'+
//                         '<td><input class="form-control DigestSale" id="DigestSale_209" name="DigestSale_209" style="width:60px" type="text" value="80" /></td>'+
//             '</tr>'+
//             '<tr>'+
//                         '<th>天下卡：</th>'+
//                         '<td><input class="form-control DigestSale" id="DigestSale_210" name="DigestSale_210" style="width:60px" type="text" value="80" /></td>'+
//                         '<th>光宇卡：</th>'+
//                         '<td><input class="form-control DigestSale" id="DigestSale_211" name="DigestSale_211" style="width:60px" type="text" value="80" /></td>'+
//                         '<th>神州行：</th>'+
//                         '<td><input class="form-control DigestSale" id="DigestSale_300" name="DigestSale_300" style="width:60px" type="text" value="80" /></td>'+
//                         '<th>联通卡：</th>'+
//                         '<td><input class="form-control DigestSale" id="DigestSale_301" name="DigestSale_301" style="width:60px" type="text" value="80" /></td>'+
//                         '<th>电信卡：</th>'+
//                         '<td><input class="form-control DigestSale" id="DigestSale_302" name="DigestSale_302" style="width:60px" type="text" value="80" /></td>'+
//             '</tr>'+
//     '</table>'+
// '</div>'+
//         '</div>'+
//     '</div>'+
//     '<div style=" margin:10px auto;">'+
//         '<input type="submit" value="确定保存" class="btn btn-blue larg" />&nbsp;    </div>'+
// '</form>'+
//         '</div>'+
//     '</div>'
// 	// }
// 	// }
// // }
// // })
// }